package VentanasEmergentes;

import java.awt.Point;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JTextField;

/*
 * esta clase nos permite poder mostrar por pantalla la ventana que ejecuta la accion de cambio de tiempo de ejecucion de las instrucciones
 * para hacerlo mas sencillo se ha extendido a la clase JDialog con el fin de poder hacer uso de sus atributos y metodos...
 */
public class CambioTiempo extends JDialog{

	private static final long serialVersionUID = 1L;//agregamos la serializable correspondiente a la clase JDialog...
	
	//atributos de la clase...
	private JButton jButton1;
    private JButton jButton2;
    private JLabel jLabel1;
    private JLabel jLabel2;
    private JTextField jTextField1;
    
    
	public JButton getjButton1() {
		return jButton1;
	}

	public JButton getjButton2() {
		return jButton2;
	}

	public JLabel getjLabel1() {
		return jLabel1;
	}

	public JLabel getjLabel2() {
		return jLabel2;
	}

	public JTextField getjTextField1() {
		return jTextField1;
	}

	//constructor de la clase, el cual nos permite poder instanciar a los atributos de la clase al momento de instanciar a esta clase...
	public CambioTiempo(){
	
		//instancia de los atributos de la clase...
		this.jButton1 = new JButton();
        this.jButton2 = new JButton();
        this.jLabel2 = new JLabel();
        this.jLabel1 = new JLabel();
        this.jTextField1 = new JTextField();
        
        //metodos asociados a JDialog...
        this.setTitle("Modifica el tiempo de instruccion");//modificamos el titulo de la ventana...
        this.setResizable(false);//modificamos la redimensionabilidad...
        this.setLocation(new Point(500,200));//modificamos la locabilidad de la ventana...
        this.setVisible(true);//modificamos la visibilidad de la ventana...
        this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);//modificamos la operacion de cierre...
        
        //llamamos al metodo que nos permite poder agregar los widgets a la ventana...
        this.AgregarWidgets();
	}
	
	//metodo que nos permite poder agregar los widgets a la ventana...
	public void AgregarWidgets(){
		
		jButton1.setText("Aceptar");

        jButton2.setText("Cancelar");

        //obtenemos la imagen desde los recursos asociados...
        jLabel2.setIcon(new javax.swing.ImageIcon(this.getClass().getResource("/res/reloj-de-clip-art_428126.jpg"))); // NOI18N

        jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        jLabel1.setText("Ingrese los segundos:");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addComponent(jLabel2)
                        .addGap(49, 49, 49)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(24, 24, 24)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jButton2)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(12, 12, 12))))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(53, 53, 53)
                        .addComponent(jButton1)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(41, 41, 41)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(jButton2))
                .addGap(24, 24, 24))
        );

        pack();
	}
}